#!/usr/bin/perl
#
#

sub expand {
	my $s = shift;
	$s =~ s/S/lr/g;
	$s =~ s/L/lSr/g;
	$s =~ s/rl/L/g;
	$s =~ s/[lr]/L/g;
	$s;
}

my $times = int shift @ARGV;

$o = 'LS';
print "$o\n";
for (1 .. $times) {
	$o = expand $o;
	print "$o\n";
}
